﻿using FluentNHibernate.Mapping;
using ScrumBox.Model;

namespace ScrumBox.DataAccess.Mappings
{
    public class ProjectMap : ClassMap<Project>
    {
        public ProjectMap()
        {
            Id(x => x.Id);
            Map(x => x.Name);
            Map(x => x.Description);
            Map(x => x.Key, "ProjectKey");
            Map(x => x.StartDate);

            HasMany<ProductBackLogItem>(x => x.GetProductBacklogItems()).AsSet();
            HasMany<Sprint>(x => x.GetSprints()).AsSet();
        }
    }
}